<template>
  <el-tabs
		class="anwser-record"
		tab-position="left"
		v-model="active">
		<el-tab-pane
			v-for="item in tableData"
			:key="item.id"
			:name="item.id"
			:label="item.createDate + ' ' + item.createTime">
			<QuestionItem
			 v-for="question in JSON.parse(item.items)"
			 :key="question.id"
			 :question="question"/>
		</el-tab-pane>
	</el-tabs>
</template>

<script setup>
import { get } from '@/axios'
import { ref } from 'vue'
import QuestionItem from '@@/question/item'
const active = ref('')
const name = ref(0)
const tableData = ref([])
const questions = ref([])
getTableData()
function getTableData () {
	get('/userAnswer/getAnwser', {}, content => {
		tableData.value = content
		console.dir(content)
		if (content.length > 0) {
			name.value = content[0].id
		}
	})
}

</script>

<style scoped lang="scss">
.anwser-record {
	height: 100%;
}
</style>